package com.leaf.u_spring.chapter01;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * 应用上下文容器的demo
 * 
 */
public class ApplicationContextDemo {

	//在指定的文件系统中查找knight.xml文件
	ApplicationContext context_1 = new FileSystemXmlApplicationContext("c:/knight.xml");
	//从所有的类路径下查找knight.xml文件
	ApplicationContext context_2 = new ClassPathXmlApplicationContext("knight.xml");
	//从Java配置中加载应用上下文
	ApplicationContext context_3 = new AnnotationConfigApplicationContext(com.leaf.u_spring.chapter01.KnightConfig.class); 
	
	
}
